<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.crm.util.RequestEx"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>CRM客户管理</title>
    <link rel="icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
    <link rel="shortcut icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>	
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui1.5.2/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui1.5.2/themes/icon.css">	
	<script type="text/javascript" src="<%=path%>/js/easyui1.5.2/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/easyui1.5.2/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/easyui1.5.2/plugins/jquery.validatebox.js?1=111"></script>
	<script type="text/javascript" src="<%=path%>/js/easyui1.5.2/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
	<style type="text/css">
		body,td,th,div{
 			font-size:12px;
		}
	</style>
  </head>
  
  <body style="margin:0;padding:0" class="easyui-layout">
    <script type="text/javascript">

	var datagrid;
	var url = "<%=path%>/user.do";

	//准备新增数据
	function readySave(){
		document.getElementById("saveAndGoon").style.display="inline";
		$('#userSaveOrUpdate').dialog({  
			title: '新增',  
			width: 600,
			height: 540,
			closed: false,  
			cache: false,   
			modal: true,
			onClose:function(){
				$('#userSaveOrUpdateForm').form('clear');
				$('.validatebox-tip').remove();
			}
		});
		var usernameEle = document.getElementById("username");
		usernameEle.readOnly = false;
		usernameEle.style.backgroundColor = "#FFFFFF";
		$("input[name='islive']").each(function(){  
		    $(this).attr("disabled",false);  
		}); 
	}
	//新增数据
	function doSave(isContinue){		
		$("#userSaveOrUpdateForm").form('submit', { 
	        url: url + '?method=saveOrUpdateUsers',	        
			success:function(data){
				if('ok' == data){
					if(isContinue){
						//$('#userSaveOrUpdateForm').form('clear');
					}else{
						$('#userSaveOrUpdate').dialog('close');
					}					
					datagrid.datagrid('reload');
				}else{
					$.messager.alert('提示', data, 'info');
				}
			},
			error : function() {
			
			}
		});
	}

	//修改数据
	function doUpdate(){
		var node = datagrid.datagrid('getSelected');
		document.getElementById("saveAndGoon").style.display="none";
		$('#userSaveOrUpdate').dialog({  
			title: '修改',  
			width: 600,
			height: 540,
			closed: false,  
			cache: false,   
			modal: true,
			onClose:function(){
				$('#userSaveOrUpdateForm').form('clear');
				$('.validatebox-tip').remove();
			}
		});
		$('#userSaveOrUpdateForm').form('load',{
			uid: node.uid,
			username: node.username,			
			nickname: node.nickname,
			pwd: node.pwd,
			pwd1: node.pwd,
			tel: node.tel,
			phone: node.phone,
			email: node.email,
			sex: node.sex,
			job: node.job,
			islive: node.islive
		});	
		var usernameEle = document.getElementById("username");
		if(node.username == 'admin'){
			usernameEle.style.backgroundColor = "#C0C0C0";
			usernameEle.readOnly = true;
			$("input[name='islive']").each(function(){  
			    $(this).attr("disabled",true);  
			}); 
		}else{
			usernameEle.readOnly = false;
			usernameEle.style.backgroundColor = "#FFFFFF";
			$("input[name='islive']").each(function(){  
			    $(this).attr("disabled",false);  
			}); 
		}
		// 1
		if(node.cusAuth.indexOf("AUTH_R") >= 0){ document.getElementById("cusAuthR").checked = true; }
		if(node.cusAuth.indexOf("AUTH_A") >= 0){ document.getElementById("cusAuthA").checked = true; }
		if(node.cusAuth.indexOf("AUTH_U") >= 0){ document.getElementById("cusAuthU").checked = true; }
		if(node.cusAuth.indexOf("AUTH_D") >= 0){ document.getElementById("cusAuthD").checked = true; }
		if(node.cusAuth.indexOf("AUTH_E") >= 0){ document.getElementById("cusAuthE").checked = true; }
		// 2
		if(node.invAuth.indexOf("AUTH_R") >= 0){ document.getElementById("invAuthR").checked = true; }
		if(node.invAuth.indexOf("AUTH_A") >= 0){ document.getElementById("invAuthA").checked = true; }
		if(node.invAuth.indexOf("AUTH_U") >= 0){ document.getElementById("invAuthU").checked = true; }
		if(node.invAuth.indexOf("AUTH_D") >= 0){ document.getElementById("invAuthD").checked = true; }
		if(node.invAuth.indexOf("AUTH_J") >= 0){ document.getElementById("invAuthJ").checked = true; }
		if(node.invAuth.indexOf("AUTH_E") >= 0){ document.getElementById("invAuthE").checked = true; }
		// 3
		if(node.invppAuth.indexOf("AUTH_R") >= 0){ document.getElementById("invppAuthR").checked = true; }
		if(node.invppAuth.indexOf("AUTH_A") >= 0){ document.getElementById("invppAuthA").checked = true; }
		if(node.invppAuth.indexOf("AUTH_U") >= 0){ document.getElementById("invppAuthU").checked = true; }
		if(node.invppAuth.indexOf("AUTH_D") >= 0){ document.getElementById("invppAuthD").checked = true; }
		if(node.invppAuth.indexOf("AUTH_J") >= 0){ document.getElementById("invppAuthJ").checked = true; }
		if(node.invppAuth.indexOf("AUTH_E") >= 0){ document.getElementById("invppAuthE").checked = true; }
		// 4
		if(node.buyAuth.indexOf("AUTH_R") >= 0){ document.getElementById("buyAuthR").checked = true; }
		if(node.buyAuth.indexOf("AUTH_A") >= 0){ document.getElementById("buyAuthA").checked = true; }
		if(node.buyAuth.indexOf("AUTH_U") >= 0){ document.getElementById("buyAuthU").checked = true; }
		if(node.buyAuth.indexOf("AUTH_D") >= 0){ document.getElementById("buyAuthD").checked = true; }
		if(node.buyAuth.indexOf("AUTH_J") >= 0){ document.getElementById("buyAuthJ").checked = true; }
		if(node.buyAuth.indexOf("AUTH_E") >= 0){ document.getElementById("buyAuthE").checked = true; }
		// 5
		if(node.kcAuth.indexOf("AUTH_R") >= 0){ document.getElementById("kcAuthR").checked = true; }
		if(node.kcAuth.indexOf("AUTH_A") >= 0){ document.getElementById("kcAuthA").checked = true; }
		if(node.kcAuth.indexOf("AUTH_U") >= 0){ document.getElementById("kcAuthU").checked = true; }
		if(node.kcAuth.indexOf("AUTH_D") >= 0){ document.getElementById("kcAuthD").checked = true; }
		if(node.kcAuth.indexOf("AUTH_J") >= 0){ document.getElementById("kcAuthJ").checked = true; }
		if(node.kcAuth.indexOf("AUTH_E") >= 0){ document.getElementById("kcAuthE").checked = true; }
		// 6
		if(node.fp1Auth.indexOf("AUTH_R") >= 0){ document.getElementById("fp1AuthR").checked = true; }
		if(node.fp1Auth.indexOf("AUTH_A") >= 0){ document.getElementById("fp1AuthA").checked = true; }
		if(node.fp1Auth.indexOf("AUTH_U") >= 0){ document.getElementById("fp1AuthU").checked = true; }
		if(node.fp1Auth.indexOf("AUTH_D") >= 0){ document.getElementById("fp1AuthD").checked = true; }
		if(node.fp1Auth.indexOf("AUTH_J") >= 0){ document.getElementById("fp1AuthJ").checked = true; }
		if(node.fp1Auth.indexOf("AUTH_E") >= 0){ document.getElementById("fp1AuthE").checked = true; }
		// 7
		if(node.fp2Auth.indexOf("AUTH_R") >= 0){ document.getElementById("fp2AuthR").checked = true; }
		if(node.fp2Auth.indexOf("AUTH_A") >= 0){ document.getElementById("fp2AuthA").checked = true; }
		if(node.fp2Auth.indexOf("AUTH_U") >= 0){ document.getElementById("fp2AuthU").checked = true; }
		if(node.fp2Auth.indexOf("AUTH_D") >= 0){ document.getElementById("fp2AuthD").checked = true; }
		if(node.fp2Auth.indexOf("AUTH_J") >= 0){ document.getElementById("fp2AuthJ").checked = true; }
		if(node.fp2Auth.indexOf("AUTH_E") >= 0){ document.getElementById("fp2AuthE").checked = true; }
		// 8
		if(node.incomeAuth.indexOf("AUTH_R") >= 0){ document.getElementById("incomeAuthR").checked = true; }
		if(node.incomeAuth.indexOf("AUTH_A") >= 0){ document.getElementById("incomeAuthA").checked = true; }
		if(node.incomeAuth.indexOf("AUTH_U") >= 0){ document.getElementById("incomeAuthU").checked = true; }
		if(node.incomeAuth.indexOf("AUTH_D") >= 0){ document.getElementById("incomeAuthD").checked = true; }
		if(node.incomeAuth.indexOf("AUTH_J") >= 0){ document.getElementById("incomeAuthJ").checked = true; }
		if(node.incomeAuth.indexOf("AUTH_E") >= 0){ document.getElementById("incomeAuthE").checked = true; }
		// 9
		if(node.offerAuth.indexOf("AUTH_R") >= 0){ document.getElementById("offerAuthR").checked = true; }
		if(node.offerAuth.indexOf("AUTH_A") >= 0){ document.getElementById("offerAuthA").checked = true; }
		if(node.offerAuth.indexOf("AUTH_U") >= 0){ document.getElementById("offerAuthU").checked = true; }
		if(node.offerAuth.indexOf("AUTH_D") >= 0){ document.getElementById("offerAuthD").checked = true; }
		if(node.offerAuth.indexOf("AUTH_X") >= 0){ document.getElementById("offerAuthX").checked = true; }
	}

	//删除数据
	function doDelete(){
		var node = datagrid.datagrid('getSelected');
		//删除确认
		$.messager.confirm('提示','<br>您确定删除选中的数据吗?',function(r){ 
			if(r){ 
				//执行删除
				var uids = "'" + node.uid + "'";

				$.ajax({
					url : url + '?method=deleteUsers',
					type : 'POST',
					data : {uids : uids},
					success : function(data, textStatus) {
						if('ok' == data){
							datagrid.datagrid('load');
						}else{								
							$.messager.alert('提示', data, 'info');
						}		
					}
				});
			} 
		});
	}
	
	//定义datagrid列模型
	var columns = [[
		{field:'oper',title:'操作',width:70,formatter:formatOper},
		{field:'uid',title:'客户主键',width:20,hidden:true},
		{field:'username',title:'用户名称',width:100},
		{field:'nickname',title:'昵称',width:100},
		{field:'tel',title:'固定电话',width:120,hidden:true},
		{field:'phone',title:'移动电话',width:120,hidden:true},
		{field:'email',title:'电子邮箱',width:120,hidden:true},
		{field:'sex',title:'性别',width:160,hidden:true},
		{field:'job',title:'职位',width:100},
		{field:'islive',title:'用户状态',width:60,formatter:formatStatus},
		
		{field:'cusAuth',title:'供应商管理权限',width:250,formatter:formatCusAuth},
		{field:'invAuth',title:'销售管理(增票)权限',width:300,formatter:formatAuth},
		{field:'invppAuth',title:'销售管理(普票)权限',width:300,formatter:formatAuth},
		{field:'buyAuth',title:'采购管理权限',width:300,formatter:formatAuth},
		{field:'kcAuth',title:'库存管理权限',width:300,formatter:formatAuth},
		{field:'fp1Auth',title:'汇款明细发票权限',width:300,formatter:formatAuth},
		{field:'fp2Auth',title:'供应商发票权限',width:300,formatter:formatAuth},
		{field:'incomeAuth',title:'销售收入管理权限',width:300,formatter:formatAuth},
		{field:'offerAuth',title:'报价单管理权限',width:300,formatter:formatOfferAuth}
	]];

	//入口
	$(function(){
		datagrid = $('#datagrid');
		$(datagrid).datagrid({
			url:url+'?method=getUsersList', 
			toolbar:'#tb',
			columns:columns,
			title:'', 
			loadMsg:'正在处理...',
			iconCls:'', 
			nowrap: true, 
			remoteSort: false,
			rownumbers: true,
			autoRowHeight: false,
			autoRowWidth: true,             
			animate:true, 
			singleSelect: true,
			collapsible: true, 
			fitColumns: false,//自动充满列
			fit:true,//自动充满浏览器区域
			idField:'uid', 
			showFooter: false,
			striped:true,//斑马线
			pagination:true,
			pageSize:50,
			pageList:[50,100,200,500],
			onClickRow:function(rowIndex, rowData){
				viewDetails(rowData);
			},
			onDblClickRow:function(rowIndex, rowData){
				doUpdate();
			},
			onLoadSuccess:function(data){

			}
		}); 
	}); 

	//格式化操作
	function formatOper(value, row){
		var updateOper = "<a href='javascript:doUpdate();'>修改</a>";
		var deleteOper = "";
		if(row.username != 'admin'){
			deleteOper = "<a href='javascript:doDelete();'>删除</a>";
		}
		
		return updateOper + '&nbsp;&nbsp;&nbsp;' + deleteOper + '&nbsp;&nbsp;&nbsp;';
	}

	//格式化权限
	function formatCusAuth(value, row){
		var auth = value;

		var authR = "<input disabled='disabled' type='checkbox'/>浏览,";
		var authA = "<input disabled='disabled' type='checkbox'/>新增,";
		var authU = "<input disabled='disabled' type='checkbox'/>修改,";
		var authD = "<input disabled='disabled' type='checkbox'/>删除,";
		var authE = "<input disabled='disabled' type='checkbox'/>导出";
		
		if(auth.indexOf("AUTH_R") >= 0){
			authR = "<input disabled='disabled' type='checkbox' checked/>浏览,";
		}
		if(auth.indexOf("AUTH_A") >= 0){
			authA = "<input disabled='disabled' type='checkbox' checked/>新增,";
		}
		if(auth.indexOf("AUTH_U") >= 0){
			authU = "<input disabled='disabled' type='checkbox' checked/>修改,";
		}
		if(auth.indexOf("AUTH_D") >= 0){
			authD = "<input disabled='disabled' type='checkbox' checked/>删除,";
		}
		if(auth.indexOf("AUTH_E") >= 0){
			authE = "<input disabled='disabled' type='checkbox' checked/>导出";
		}
		return authR + authA + authU + authD + authE;
	}

	//格式化权限
	function formatOfferAuth(value, row){
		var auth = value;

		var authR = "<input disabled='disabled' type='checkbox'/>浏览,";
		var authA = "<input disabled='disabled' type='checkbox'/>上传,";
		var authU = "<input disabled='disabled' type='checkbox'/>修改,";
		var authD = "<input disabled='disabled' type='checkbox'/>删除,";
		var authX = "<input disabled='disabled' type='checkbox'/>下载";
		
		if(auth.indexOf("AUTH_R") >= 0){
			authR = "<input disabled='disabled' type='checkbox' checked/>浏览,";
		}
		if(auth.indexOf("AUTH_A") >= 0){
			authA = "<input disabled='disabled' type='checkbox' checked/>上传,";
		}
		if(auth.indexOf("AUTH_U") >= 0){
			authU = "<input disabled='disabled' type='checkbox' checked/>修改,";
		}
		if(auth.indexOf("AUTH_D") >= 0){
			authD = "<input disabled='disabled' type='checkbox' checked/>删除,";
		}
		if(auth.indexOf("AUTH_E") >= 0){
			authX = "<input disabled='disabled' type='checkbox' checked/>下载";
		}
		return authR + authA + authU + authD + authX;
	}
	
	//格式化权限
	function formatAuth(value, row){
		var auth = value;

		var authR = "<input disabled='disabled' type='checkbox'/>浏览,";
		var authA = "<input disabled='disabled' type='checkbox'/>新增,";
		var authU = "<input disabled='disabled' type='checkbox'/>修改,";
		var authD = "<input disabled='disabled' type='checkbox'/>删除,";
		var authJ = "<input disabled='disabled' type='checkbox'/>计算,";
		var authE = "<input disabled='disabled' type='checkbox'/>导出";
		
		if(auth.indexOf("AUTH_R") >= 0){
			authR = "<input disabled='disabled' type='checkbox' checked/>浏览,";
		}
		if(auth.indexOf("AUTH_A") >= 0){
			authA = "<input disabled='disabled' type='checkbox' checked/>新增,";
		}
		if(auth.indexOf("AUTH_U") >= 0){
			authU = "<input disabled='disabled' type='checkbox' checked/>修改,";
		}
		if(auth.indexOf("AUTH_D") >= 0){
			authD = "<input disabled='disabled' type='checkbox' checked/>删除,";
		}
		if(auth.indexOf("AUTH_J") >= 0){
			authJ = "<input disabled='disabled' type='checkbox' checked/>计算,";
		}
		if(auth.indexOf("AUTH_E") >= 0){
			authE = "<input disabled='disabled' type='checkbox' checked/>导出";
		}
		return authR + authA + authU + authD + authJ + authE;
	}

	//格式化价格
	function formatStatus(value, row){
		var tempValue = value + '';
		if(tempValue == 'Y'){
			return '启用';
		}else if(tempValue == 'N'){
			return '<font color=red>停用</font>';
		}
		return '未知';
	}

	function setAuth(ele){
		if("AUTH_R" == ele.value){
			if(!ele.checked){
				var array = document.getElementsByName(ele.name);
				for(var i = 0; i < array.length; i ++){
					array[i].checked = ele.checked;
				}
			}
		}else{
			if(ele.checked){
				var array = document.getElementsByName(ele.name);
				for(var i = 0; i < array.length; i ++){
					if("AUTH_R" == array[i].value){
						array[i].checked = ele.checked;
						break;
					}
				}
			}
		} 
	}
	</script>

	<div data-options="region:'center',title:'用户管理'">
	
	<!-- 表格面板 -->
	<table id="datagrid"></table>
	
	<!-- 新增或编辑面板 -->
	<div id="userSaveOrUpdate" class="easyui-dialog" closed="true" data-options="buttons:'#buttonsSaveOrUpdate'" style="padding-top:10px;padding-right:10px;overflow:hidden">
	    <form id="userSaveOrUpdateForm" name="userSaveOrUpdateForm" action="" method="post">
	    	<input type="hidden" id="uid" name="uid" value="">
	    	<table border="0" bordercolor="red">
				<tr height="30px">
	    			<td width="60px" align="right">用户名称</td>
	    			<td>
	    				<input style="width:210px" class="easyui-validatebox" type="text" id="username" name="username" data-options="required:true,validType:['letterNumberUnderline[5,20]']"/><font color="red">*</font>	
	    			</td>
	    			<td width="60px" align="right">昵称</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="text" id="nickname" name="nickname" data-options="required:true,validType:['length[0,20]']"/><font color="red">*</font></td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">密码</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="password" id="pwd" name="pwd" data-options="required:true,validType:['length[6,20]']"/><font color="red">*</font></td>
	    			<td align="right">确认密码</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="password" id="pwd1" name="pwd1" data-options="required:true,validType:['samepwd[\'pwd\']']"/><font color="red">*</font></td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">固定电话</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="text" id="tel" name="tel" data-options="validType:['length[0,100]']"/></td>
	    			<td align="right">移动电话</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="text" id="phone" name="phone" data-options="validType:['length[0,100]']"/></td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">电子邮箱</td>
	    			<td><input style="width:210px" class="easyui-validatebox" type="text" id="email" name="email" data-options="validType:'email'"/></td>
	    			<td align="right">性别</td>
	    			<td>
	    				<input type="radio" id="sexMan" name="sex" value="男" checked/>男&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	    				<input type="radio" id="sexWoman" name="sex" value="女"/>女
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">职位</td>
	    			<td><input style=width:210px class="easyui-validatebox" type="text" id="job" name="job" data-options="validType:['length[0,50]']"/></td>
	    			<td align="right">是否启用</td>
	    			<td>
	    				<input type="radio" id="isliveY" name="islive" value="Y" checked/>启用&nbsp;&nbsp;&nbsp;&nbsp;
	    				<input type="radio" id="isliveN" name="islive" value="N"/>停用
	    			</td>
	    		</tr>

	    		<tr height="30px">
	    			<td align="right">供应商管理</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="cusAuthR" name="cusAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="cusAuthA" name="cusAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="cusAuthU" name="cusAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="cusAuthD" name="cusAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="cusAuthE" name="cusAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">增票</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthR" name="invAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthA" name="invAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthU" name="invAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthD" name="invAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthJ" name="invAuth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invAuthE" name="invAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">普票</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthR" name="invppAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthA" name="invppAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthU" name="invppAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthD" name="invppAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthJ" name="invppAuth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="invppAuthE" name="invppAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">采购管理</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthR" name="buyAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthA" name="buyAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthU" name="buyAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthD" name="buyAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthJ" name="buyAuth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="buyAuthE" name="buyAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">库存管理</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthR" name="kcAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthA" name="kcAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthU" name="kcAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthD" name="kcAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthJ" name="kcAuth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="kcAuthE" name="kcAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">汇款明细</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthR" name="fp1Auth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthA" name="fp1Auth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthU" name="fp1Auth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthD" name="fp1Auth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthJ" name="fp1Auth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp1AuthE" name="fp1Auth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">供应商发票</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthR" name="fp2Auth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthA" name="fp2Auth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthU" name="fp2Auth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthD" name="fp2Auth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthJ" name="fp2Auth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="fp2AuthE" name="fp2Auth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">销售收入</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthR" name="incomeAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthA" name="incomeAuth" value="AUTH_A"/>新增&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthU" name="incomeAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthD" name="incomeAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthJ" name="incomeAuth" value="AUTH_J"/>计算&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="incomeAuthE" name="incomeAuth" value="AUTH_E"/>导出
	    			</td>
	    		</tr>
	    		<tr height="30px">
	    			<td align="right">报价单</td>
	    			<td colspan="3" >
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="offerAuthR" name="offerAuth" value="AUTH_R"/>浏览&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="offerAuthA" name="offerAuth" value="AUTH_A"/>上传&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="offerAuthU" name="offerAuth" value="AUTH_U"/>修改&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="offerAuthD" name="offerAuth" value="AUTH_D"/>删除&nbsp;&nbsp;
	    				<input onClick="javascript:setAuth(this)" type="checkbox" id="offerAuthX" name="offerAuth" value="AUTH_X"/>下载
	    			</td>
	    		</tr>
	    	</table>
	    </form>
	</div>
	<div id="buttonsSaveOrUpdate" style="display:none">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:doSave(false)">保存</a>
		<a href="javascript:void(0)" id="saveAndGoon" class="easyui-linkbutton" onclick="javascript:doSave(true)">保存并继续新增</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#userSaveOrUpdate').dialog('close');">关闭</a>
	</div>
	
	<!-- 增，删，改，查面板 -->
	<div id="tb" style="padding:0px;height:auto">
		<table width="100%" border="0" bordercolor="red">
			<tr>
				<td style="padding-right:10px">
					<a href="javascript:readySave();" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'">新增</a>
				</td>				
			</tr>
		</table>
	</div>
	
	</div>
  </body>
</html>
